3.25.60 \(\int x (a+b x^n)^2 \, dx\) [2460]

Optimal. Leaf size=44 \[ \frac {a^2 x^2}{2}+\frac {b^2 x^{2 (1+n)}}{2 (1+n)}+\frac {2 a b x^{2+n}}{2+n} \]

[Out]

1/2*a^2*x^2+1/2*b^2*x^(2+2*n)/(1+n)+2*a*b*x^(2+n)/(2+n)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 44, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.091, Rules used = {276} \begin {gather*} \frac {a^2 x^2}{2}+\frac {2 a b x^{n+2}}{n+2}+\frac {b^2 x^{2 (n+1)}}{2 (n+1)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[x*(a + b*x^n)^2,x]

[Out]

(a^2*x^2)/2 + (b^2*x^(2*(1 + n)))/(2*(1 + n)) + (2*a*b*x^(2 + n))/(2 + n)

Rule 276

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*(a + b*x^n)^p,
 x], x] /; FreeQ[{a, b, c, m, n}, x] && IGtQ[p, 0]

Rubi steps

\begin {align*} \int x \left (a+b x^n\right )^2 \, dx &=\int \left (a^2 x+2 a b x^{1+n}+b^2 x^{1+2 n}\right ) \, dx\\ &=\frac {a^2 x^2}{2}+\frac {b^2 x^{2 (1+n)}}{2 (1+n)}+\frac {2 a b x^{2+n}}{2+n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.04, size = 37, normalized size = 0.84 \begin {gather*} \frac {1}{2} x^2 \left (a^2+\frac {4 a b x^n}{2+n}+\frac {b^2 x^{2 n}}{1+n}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[x*(a + b*x^n)^2,x]

[Out]

(x^2*(a^2 + (4*a*b*x^n)/(2 + n) + (b^2*x^(2*n))/(1 + n)))/2

________________________________________________________________________________________

Maple [A]
time = 0.21, size = 43, normalized size = 0.98

method result size
risch \(\frac {a^{2} x^{2}}{2}+\frac {b^{2} x^{2} x^{2 n}}{2+2 n}+\frac {2 a b \,x^{2} x^{n}}{2+n}\) \(43\)
norman \(\frac {a^{2} x^{2}}{2}+\frac {b^{2} x^{2} {\mathrm e}^{2 n \ln \left (x \right )}}{2+2 n}+\frac {2 a b \,x^{2} {\mathrm e}^{n \ln \left (x \right )}}{2+n}\) \(47\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a+b*x^n)^2,x,method=_RETURNVERBOSE)

[Out]

1/2*a^2*x^2+1/2*b^2/(1+n)*x^2*(x^n)^2+2*a*b/(2+n)*x^2*x^n

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 40, normalized size = 0.91 \begin {gather*} \frac {1}{2} \, a^{2} x^{2} + \frac {b^{2} x^{2 \, n + 2}}{2 \, {\left (n + 1\right )}} + \frac {2 \, a b x^{n + 2}}{n + 2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="maxima")

[Out]

1/2*a^2*x^2 + 1/2*b^2*x^(2*n + 2)/(n + 1) + 2*a*b*x^(n + 2)/(n + 2)

________________________________________________________________________________________

Fricas [A]
time = 0.42, size = 72, normalized size = 1.64 \begin {gather*} \frac {{\left (b^{2} n + 2 \, b^{2}\right )} x^{2} x^{2 \, n} + 4 \, {\left (a b n + a b\right )} x^{2} x^{n} + {\left (a^{2} n^{2} + 3 \, a^{2} n + 2 \, a^{2}\right )} x^{2}}{2 \, {\left (n^{2} + 3 \, n + 2\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="fricas")

[Out]

1/2*((b^2*n + 2*b^2)*x^2*x^(2*n) + 4*(a*b*n + a*b)*x^2*x^n + (a^2*n^2 + 3*a^2*n + 2*a^2)*x^2)/(n^2 + 3*n + 2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (36) = 72\).
time = 0.16, size = 201, normalized size = 4.57 \begin {gather*} \begin {cases} \frac {a^{2} x^{2}}{2} + 2 a b \log {\left (x \right )} - \frac {b^{2}}{2 x^{2}} & \text {for}\: n = -2 \\\frac {a^{2} x^{2}}{2} + 2 a b x + b^{2} \log {\left (x \right )} & \text {for}\: n = -1 \\\frac {a^{2} n^{2} x^{2}}{2 n^{2} + 6 n + 4} + \frac {3 a^{2} n x^{2}}{2 n^{2} + 6 n + 4} + \frac {2 a^{2} x^{2}}{2 n^{2} + 6 n + 4} + \frac {4 a b n x^{2} x^{n}}{2 n^{2} + 6 n + 4} + \frac {4 a b x^{2} x^{n}}{2 n^{2} + 6 n + 4} + \frac {b^{2} n x^{2} x^{2 n}}{2 n^{2} + 6 n + 4} + \frac {2 b^{2} x^{2} x^{2 n}}{2 n^{2} + 6 n + 4} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x**n)**2,x)

[Out]

Piecewise((a**2*x**2/2 + 2*a*b*log(x) - b**2/(2*x**2), Eq(n, -2)), (a**2*x**2/2 + 2*a*b*x + b**2*log(x), Eq(n,
 -1)), (a**2*n**2*x**2/(2*n**2 + 6*n + 4) + 3*a**2*n*x**2/(2*n**2 + 6*n + 4) + 2*a**2*x**2/(2*n**2 + 6*n + 4)
+ 4*a*b*n*x**2*x**n/(2*n**2 + 6*n + 4) + 4*a*b*x**2*x**n/(2*n**2 + 6*n + 4) + b**2*n*x**2*x**(2*n)/(2*n**2 + 6
*n + 4) + 2*b**2*x**2*x**(2*n)/(2*n**2 + 6*n + 4), True))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 87 vs. \(2 (40) = 80\).
time = 1.20, size = 87, normalized size = 1.98 \begin {gather*} \frac {b^{2} n x^{2} x^{2 \, n} + 4 \, a b n x^{2} x^{n} + a^{2} n^{2} x^{2} + 2 \, b^{2} x^{2} x^{2 \, n} + 4 \, a b x^{2} x^{n} + 3 \, a^{2} n x^{2} + 2 \, a^{2} x^{2}}{2 \, {\left (n^{2} + 3 \, n + 2\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x*(a+b*x^n)^2,x, algorithm="giac")

[Out]

1/2*(b^2*n*x^2*x^(2*n) + 4*a*b*n*x^2*x^n + a^2*n^2*x^2 + 2*b^2*x^2*x^(2*n) + 4*a*b*x^2*x^n + 3*a^2*n*x^2 + 2*a
^2*x^2)/(n^2 + 3*n + 2)

________________________________________________________________________________________

Mupad [B]
time = 1.24, size = 43, normalized size = 0.98 \begin {gather*} \frac {a^2\,x^2}{2}+\frac {b^2\,x^{2\,n}\,x^2}{2\,n+2}+\frac {2\,a\,b\,x^n\,x^2}{n+2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x*(a + b*x^n)^2,x)

[Out]

(a^2*x^2)/2 + (b^2*x^(2*n)*x^2)/(2*n + 2) + (2*a*b*x^n*x^2)/(n + 2)

________________________________________________________________________________________